import request from '@/utils/request'

// 登录方法
export function login(username, password, captchaVerification) {
	const data = {
		"mobile": username,
		"code": password,
		"socialType": 10,
		"socialCode": "1024",
		"socialState": "9b2ffbc1-7425-4155-9894-9d5c08541d62",
		"socialCodeValid": true
	}

	return request({
		// url: '/system/auth/login',
		url: '/member/auth/sms-login',
		headers: {
			isToken: false
		},
		'method': 'POST',
		'data': data
	})
}

// 登录方法
export function loginByCode(phoneCode, loginCode) {
	const data = {
		"phoneCode": phoneCode,
		"loginCode": loginCode,
		"state": "9b2ffbc1-7425-4155-9894-9d5c08541d62",
	}

	return request({
		// url: '/system/auth/login',
		url: '/member/auth/weixin-mini-app-login',
		headers: {
			isToken: false
		},
		'method': 'POST',
		'data': data
	})
}

// 获取用户详细信息
export function getInfo() {
	return request({
		// url: '/system/auth/get-permission-info',
		url: '/member/user/get',
		'method': 'GET'
	})
}

// 退出方法
export function logout() {
	return request({
		url: '/system/auth/logout',
		'method': 'POST'
	})
}